import React from 'react';

import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';

import { Button, Welcome } from '@storybook/react/demo';
import FightRecord from '../FightRecord.js';

import avatar from './avatar_no_one.png';

const defaultFightRecord = {
  room_code: '349231',
  room_id: '2018年08月23日 12:23:00 349231',
  played_at: '2018年08月23日 12:23:00',
  round_title: '桂林跑牌(12局)',
  scores: [
    {
      name: '饼干泡白开水',
      avatar: avatar,
      score: 999,
      wins: 0,
      finnal_score: 995,
    },
    {
      name: '饼干泡白开水',
      avatar: avatar,
      score: 999,
      wins: 0,
      finnal_score: 995,
    },
    {
      name: '饼干泡白开水',
      avatar: avatar,
      score: 999,
      wins: 0,
      finnal_score: 995,
    },
    {
      name: '饼干泡白开水',
      avatar: avatar,
      score: 999,
      wins: 0,
      finnal_score: 995,
    },
  ],
};

storiesOf('战绩', module).add('分享的战绩', () => <FightRecord {...defaultFightRecord} />);

storiesOf('Button', module)
  .add('with text', () => <Button onClick={action('clicked')}>Hello Button</Button>)
  .add('with some emoji', () => (
    <Button onClick={action('clicked')}>
      <span role="img" aria-label="so cool">
        😀 😎 👍 💯
      </span>
    </Button>
  ));
